<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>

</body>
<script>
// 普通数组
let asyncRoutesStr = ['employees','departments','settings']
//要求1-过滤出内容为'employees','settings'的数据
let menus = ['employees','settings']
// let filterRoutesObj = [asyncRoutesObj.filter(t =>['employees','settings'].includes(t) )]

// 对象数组
let asyncRoutesObj = [{name: 'employees'}, {name: 'departments'}, {name: 'settings'}]
//要求2-过滤出name为'employees','settings的数据
// let filterRoutesObj = [asyncRoutesObj.filter(t =>['employees','settings'].includes(t.name) )]

// 复杂的对象数组
let asyncRoutes = [
  {chidren:[{name: 'employees'}]},
  {chidren:[{name: 'departments'}]},
  {chidren:[{name: 'settings'}]}
]
//要求3-过滤出子元素name为'employees','settings的数据
// let filterRoutesObj = [asyncRoutesObj.filter(t =>['employees','settings'].includes(t.children[0].name) )]

let asyncRoutess = [
  {chidren:[{name: 'employees'}]},
  {chidren:[{name: 'departments'}]},
  {chidren:[{name: 'settings'}]}
]
</script>
</html>
